<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../css/utils/bootstrap.min.css" />
    <link rel="stylesheet" href="../../css/utils/bootstrap-datetimepicker.css" />
    <link rel="stylesheet" href="../../css/utils/toastr.min.css" />
    <link rel="stylesheet" href="../../css/utils/mui.min.css" />
    <link rel="stylesheet" href="../../css/utils/common.css" />
	<title></title>
	<style>
		.search-button {
			margin-top: 50px;
		}
		.operate-btn .btn {
			padding: 6px 20px;
			margin-left: 20px;
		}
		.row-list {
			margin-top: 50px;
		}
		.row-list .thumbnail {
			padding: 6px;
			border: none;
			background: url(../../img/myTask/block-back.png) no-repeat;
			background-size: 100% 100%;
		}
		.img-layer {
			position: relative;
			padding: 40px 20px 20px 20px;
		}
		.float-btn {
			margin-top: 50px;
			text-align: center;
		}
		.float-btn button {
			width: 168px;
		    background-color: #11B5AB;
		    color: #fff;
		    border-color: #11B5AB;
		}
		.float-btn button:focus, .float-btn button:hover {
			color: #fff;
			background-color: #2aeee2;
		}
		.float-bottom {
			position: absolute;
			left: 20px;
			right: 20px;
			bottom: 10px;
			color: #fff;
		}
		.img-btn {
			cursor: pointer;
		}
		.img-btn img {
			width: 14px;
			margin-right: 5px;
			vertical-align: middle;
		}
		.img-btn span {
			vertical-align: middle;
		}
		
		.float-status {
			position: absolute;
			top: 0;
			right: 0;
			width: 70px;
			height: 70px;
		}
		.float-status.status-end {
			background: url(../../img/redPacket/status-end.png) no-repeat;
			background-size: 100% 100%;
		}
		.float-status.status-pause {
			background: url(../../img/redPacket/status-pause.png) no-repeat;
			background-size: 100% 100%;
		}
		.float-status.status-go {
			background: url(../../img/redPacket/status-go.png) no-repeat;
			background-size: 100% 100%;
		}
		.img-layer .text-title {
			margin-bottom: 15px;
		}
		.division-line {
			margin-top: 15px;
			border-top: 1px solid #A1A1A1;
		}
		.img-span {
			margin-top: 20px;
		}
		.img-span img {
			width: 20px;
			margin-right: 8px;
			vertical-align: middle;
		}
		.img-span span {
			vertical-align: middle;
		}
		.row-list .caption {
			position: relative;
			padding: 20px;
			background: #f3f3f3;
		}
		.red-packet-price img {
			width: 20px;
			margin-right: 8px;
		}
		.red-packet-price span {
			vertical-align: middle;
		}
		.red-packet-price img:nth-child(3) {
			margin-left: 20px;
		}
		/*model样式*/
		.keyword-btn {
			display: flex;
			justify-content:space-between;
			margin-top: 10px;
		}
		.keyword-search {
			width: 45%;
			height: 32px;
			background: url(../../img/redPacket/keyword-search.png) no-repeat center;
			background-size: 100% 100%;
		}
		.keyword-search input[type="search"] {
			width: 90%;
			height: 32px;
			margin-left: 25px;
			background-color: transparent;
			border: none;
		}
		.keyword-search input[type="search"]:focus{
		    box-shadow: none;
		}
		.keyword-search input[type="search"]::-webkit-input-placeholder {
			text-align: center;
		}
		.keyword-btn .publish-button {
			width: 45%;
		}
		.activity-title {
			margin-top: 20px;
		}
		.activity-title input[type="text"]::-webkit-input-placeholder {
			text-align: center;
		}
		.article-list {
			position: relative;
			padding: 10px 30px;
			margin-top: 30px;
			height: 350px;
			border: 1px solid #898989;
			border-radius: 5px;
			overflow: hidden;
		}
		.article-list .list-li {
			border-bottom: 1px solid #B5B5B5;
			padding: 10px 0;
		}
		.article-info {
			color: #B5B5B5;
		}
		.article-info span {
			margin-right: 20px;
		}
		.float-absolute {
			position: absolute;
			top: 22px;
			right: 10px;
		}
		.float-absolute input[type=radio] {
			width: 16px;
			height: 16px;
		}
		
		.body-center {
			margin: 0 auto;
			padding-right: 15px;
			/*width: 90%;*/
		}
		.form-tab {
			width: 75%;
			margin-bottom: 15px;
		}
		.form-tab.bloack-tab {
			width: 100%;
			padding-left: 43px;
		}
		.form-tab button {
			background-color: #EEEEEE;
			border-color: #FFF;
			color: #666666;
		}
		.form-tab button:focus {
			outline: none !important;
			outline-offset: 0 !important;
		}
		.form-tab .btn-default.active:focus, .publish-button .btn-default.active:hover {
			color: #fff;
			background-color: #2aeee2;
			border-color: #FFF;
		}
		.form-tab button.active {
			color: #fff;
			background-color: #11B5AB;
			border-color: #FFF;
		}
		.array-input {
			width: 120px !important;
			display: inline-block;
			vertical-align: baseline;
		}
		.short-line {
			display: inline-block;
			vertical-align: middle;
			width: 20px;
			height: 1px;
			margin: 0 5px;
    		background-color: #ccc;
		}
		.text-4f-bold {
			padding-right: 30px;
		}
		.input-label {
			padding-top: 7px;
			padding-bottom: 10px;
		}
		.form-horizontal .form_datetime {
			width: 100%;
		}
		#redPacketModal2 .modal-footer,#redPacketModal3 .modal-footer {
			text-align: center;
		}
		#redPacketModal2 .form-group {
			position: relative;
			margin-bottom: 0;
		}
		#redPacketModal2 .form-group .form-inline {
			margin-left: 58px;
		}
		#redPacketModal2 .form-group .form-inline select {
			border: 1px solid #ccc !important;
		}
		.baidu-map-btn {
			padding-left: 43px;
		}
		.baidu-map-btn input[type='text'] {
			display: inline-block;
			width: 220px;
		}
		#baiduMap {
			width: 100%;
			height: 450px;
		}
		#r-result {
			width: 100%;
		}
		#selectRegion {
			display: none;
		}
		#selectCoordinate {
			display: none;
			margin-left: 0;
		}
		#selectCoordinate input[type='text'] {
			height: 34px;
		}
		.brush-limit {
			line-height: 40px;
		}
		.brush-limit img {
			width: 20px;
			height: 20px;
		}
		.brush-popover {
			display: none;
			position: absolute;
			top: -20px;
    		right: -260px;
			width: 260px;
			border: 1px solid #A1A1A1;
			padding: 10px;
			border-radius: 10px;
			background-color: #fff;
		}
		.renew-list {
			padding: 30px 10px 30px 50px;
		}
		.renew-list .list-li {
			padding: 10px 0;
		}
		.font-row span:first-child {
			width: 60%;
		}
		.font-row span:last-child {
			width: 40%;
		}
		.renew-list .control-label {
			padding-top: 7px;
			padding-left: 0;
		}
		.top-up {
			padding-top: 30px;
			text-align: center;
		}
		/*红包封面设置*/
		.the-cover {
			padding: 30px 50px;
		}
		.words-limit {
			position: relative;
			margin-bottom: 20px;
		}
		.words-limit .number-words {
			position: absolute;
			top: 9px;
			right: 20px;
			color: #4f4f4f;
		    font-size: 11px;
		}
		.red-packet-preview {
			padding-top: 20px;
		}
		.goods-preview {
			width: 200px;
			border: 1px solid #E1E1E1;
			color: #303030;
		}
		.goods-preview .title {
			height: 35px;
			line-height: 35px;
			text-align: center;
			border-bottom: 1px solid #E1E1E1;
		}
		.goods-preview .body {
			padding: 20px 10px;
		}
		.edit-preview {
			padding: 10px 0;
			min-height: 80px;
		}
		.goods-preview .footer {
			height: 35px;
			line-height: 35px;
			text-align: center;
			border-top: 1px solid #E1E1E1;
		}
		.red-preview {
			width: 200px;
			height: 285px;
			padding: 0 25px;
			background: url(../../img/redPacket/red-packet-back.png) no-repeat;
			background-size: 100% 100%;
			color: #FFCC2F;
			text-align: center;
		}
		.red-preview p {
			color: #FFCC2F;
		}
		.preview-font {
			margin-top: 120px;
		}
		.balance {
			color: red;
		}
		#merchantBalance {
			display: none;
		}
		.recharge-money {
			display: inline-block;
			width: 50%;
			margin: 0 auto;
			margin-left: -3px;
			text-align: center;
			border-right: 1px solid #A1A1A1;
		}
		.recharge-money-btn {
			margin-top: 30px;
			margin-left: -10px;
			margin-right: -10px;
		}
		.recharge-btn button {
			width: 90px;
			margin-left: 10px;
			margin-right: 10px;
			margin-bottom: 10px;
		}
		.recharge-btn button.active {
			border-color: #11B5AB;
		} 
		.recharge-btn .btn-default.active:hover, .recharge-btn .btn-default:active.focus {
			border-color: #11B5AB;
		}
		.recharge-input {
			margin-top: 10px;
		}
		.recharge-input input {
			display: inline-block;
			width: 240px;
			margin-left: 20px;
			margin-right: 15px;
		}
		.recharge-prompt {
			background-color: #F3F3F3;
			margin: 0 auto;
			text-align: left;
			width: 330px;
			padding: 10px;
		}
		.recharge-pay-btn {
			margin: 30px auto;
			width: 230px;
		}
		.recharge-code {
			display: inline-block;
			vertical-align: top;
			margin: 0 auto;
			text-align: center;
			margin-left: -2px;
			width: 50%;
		}
		.wepay-logo {
			margin-top: 40px;
		}
		.wepay-logo img {
			width: 130px;
		}
		.recharge-qrcode {
			width: 220px;
			height: 220px;
			margin: 20px auto;
			border: 1px solid #11B5AB;
		}
		.recharge-qrcode canvas {
			width: 100%;
			height: 100%;
		}
		.wepay-prompt img {
			margin-top: 20px;
			width: 180px;
		}
		/*预览model*/
		.preview-content {
			display: flex;
		}
		.phone-model {
			width: 260px;
			height: 500px;
			margin: 50px 70px;
			padding: 95px 15px 58px 13px;
			background: url(../../img/myExtension/phone-model.png) no-repeat;
			background-size: 100% 100%;
		}
		.phone-content {
			position: relative;
			width: 100%;
			height: 100%;
			padding: 0 0 10px 10px;
			color: #666666;
		}
		#previewArticle {
			padding-top: 10px;
			padding-bottom: 50px;
		}
		.phone-title {
			color: #111;
			/*font-size: 16px;*/
		}
		.phone-body {
			font-size: 12px;
		}
		.phone-body img {
			max-width: 100%;
			height: auto;
		}
		.scan-wechat {
			margin-top: 70px;
		}
		.preview-qrcode {
			width: 386px;
			height: 220px;
			border: 1px solid #A1A1A1;
			text-align: center;
		}
		.preview-qrcode .qrcode {
			width: 150px;
			height: 150px;
			margin: 0 auto;
			margin-top: 25px;
			border: 1px solid #A1A1A1;
		}
		.preview-qrcode .qrcode canvas {
			width: 100%;
			height: 100%;
		}
		.preview-qrcode .prompt {
			margin-top: 10px;
			color: #6B6B6B;
		}
		.wechat-share {
			margin-top: 110px;
			padding: 10px;
			width: 386px;
			height: 132px;
			border: 1px solid #A1A1A1;
		}
		.wechat-title {
			font-size: 16px;
			color: #666666;
		}
		.wechat-content {
			display: flex;
			margin-top: 20px;
		}
		.wechat-describe {
			width: calc(100% - 80px);
			height: 62px;
			color: #8E8E8E;
			display: -webkit-box;
		    overflow: hidden;
		    white-space: normal!important;
		    text-overflow: ellipsis;
		    word-wrap: break-word;
		    -webkit-line-clamp: 3;
		    -webkit-box-orient: vertical;
		}
		.wechat-icon img {
			vertical-align: top;
			margin-left: 10px;
			width: 60px;
			height: 60px;
		}
		/*nar报名卡片*/
		.mui-bar {
			position: absolute;
			font-size: 12px;
		}
		.tickets-tab {
			display: none;
		}
		.enroll-tab {
			display: none;
		}
		.mui-bar .mui-btn,.mui-bar button {
			font-size: 12px;
		}
		.title-item {
			display: table-cell;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			vertical-align: middle;
			padding-left: 10px;
			color: #333;
		}
		.btn-item {
			width: 85px;
			display: table-cell;
			text-align: center;
		}
		.mui-bar .mui-btn {
			padding: 6px 12px;
		}
		/*nar名片卡片*/
		.card-tab {
			display: none;
		}
		.merge-tab {
			display: none;
		}
		.merge-qrcode-item {
			display: none;
		}
		.merge-enroll-item {
			display: none;
		}
		.merge-ticket-item {
			display: none;
		}
		.merge-user-item {
			display: none;
			position: relative;
			display: table-cell;
			vertical-align: middle;
			padding-left: 10px;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			height: 50px;
		}
		.user-item {
			position: relative;
			display: table-cell;
			vertical-align: middle;
			padding-left: 5px;
			-webkit-flex: 1;
			-moz-box-flex: 1;
			-ms-flex: 1;
			flex: 1;
			height: 50px;
		}
		.head-img {
			position: absolute;
			top: -15px;
			width: 45px;
			height: 45px;
			padding: 1px;
			border-radius: 50%;
			background-color: #fff;
		}
		.head-img img {
			width: 100%;
			height: 100%;
			border-radius: 50%;
		}
		.qrcode-item {
			display: table-cell;
		}
		.phone-item {
			display: table-cell;
		}
		.icon-item {
			width: 30px;
			height: 30px;
			border-left: 1px solid #CBCBCB;
			vertical-align: middle;
 		   	text-align: center;
		}
		.icon-item img {
			width: 15px;
			height: 15px;
		}
		.user-info-bar {
			margin-left: 48px;
			color: #333;
		}
		.user-info-bar .name {
			margin-right: 10px;
		}
		.user-info-bar .position {
			font-size: 12px;
			color: #666666;
		}
		
		#rechargeMoneyRecord {
			display: none;
		}
	</style>
</head>
<body>
	<div class="content">
		<div class="search-button">
			<div class="search-content">
				<input type="search" id="searchRedPacket" class="form-control" placeholder="搜索文章标题">
			</div>
			<div class="operate-btn">
				<button type="button" id="createRedpacket" class="btn btn-default">新建红包活动</button>
				<button type="button" onclick="javascript:window.parent.location='../index.html?path=redPacket/draftBox.html'" class="btn btn-default">草稿箱</button>
				<button type="button" id="rechargeMoney" class="btn btn-default">充值</button>
				<button type="button" id="rechargeMoneyRecord" class="btn btn-default">充值记录</button>
			</div>
		</div>
		<div class="row row-list">
			<!--<div class="col-sm-6 col-lg-3">
				<div class="thumbnail">
					<div class="img-layer">
						<div class="floating-layer">
							<div class="float-btn">
								<p><button class="btn btn-default" type="button">活动详情</button></p>
							</div>
							<div class="float-bottom space-between">
								<div class="img-btn">
									<img src="../../img/redPacket/stop.png" /><span>停止</span>
								</div>
								<div class="img-btn">
									<img src="../../img/redPacket/suspend.png" /><span>暂停</span>
								</div>
								<div class="img-btn renew-money">
									<img src="../../img/redPacket/recharge.png" /><span>追加红包</span>
								</div>
							</div>
						</div>
						<div class="float-status status-go"></div>
						<div class="text-title text-ellipsis">文章标题</div>
						<div class="text-8b">发布时间：2018-4-19 16:23:05</div>
						<div class="text-8b">结束时间：2018-4-19 16:23:05</div>
						<div class="division-line"></div>
						<div class="space-between text-8b img-span">
							<div><img src="../../img/myExtension/content-read.png" /><span>1651</span></div>
							<div><img src="../../img/myExtension/content-share.png" /><span>48641</span></div>
							<div><img src="../../img/myExtension/content-praise.png" /><span>1654</span></div>
						</div>
						
					</div>
					<div class="caption space-between">
						<div class="red-packet-price text-8b">
							<img src="../../img/redPacket/packet-num.png" /><span>5个</span><img src="../../img/redPacket/price.png" /><span>4.34 / 5.0</span>
						</div>
						<div><a href="redPacketDetails.html">红包详情</a></div>
					</div>
				</div>
			</div>-->
		</div>
		<nav id="page" class="text-center" aria-label="Page navigation">
			<ul class="pagination">
			</ul>
		</nav>
	</div>
	<!-- 新建红包活动Modal -->
	<div class="modal fade" id="redPacketModal1" tabindex="-1" role="dialog" aria-labelledby="redPacketModal1Label">
	  	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      	<div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="redPacketModal1Label">设置红包活动</h4>
		     	</div>
			    <div class="modal-body">
		        	<div class="keyword-btn">
						<div class="keyword-search">
							<input type="search" id="searchArticle" class="form-control" placeholder="文章标题">
						</div>
						<div id="articleAndTask" class="btn-group btn-group-justified publish-button" role="group" aria-label="button-group">
							<div class="btn-group" role="group">
								<button type="button" data-param="1" class="btn btn-default active">我的推文</button>
							</div>
							<div class="btn-group" role="group">
								<button type="button" data-param="2" class="btn btn-default">我的任务</button>
							</div>
						</div>
					</div>
					<div id="pullrefresh" class="article-list">
						<ul class="list-ul">
							<!--<li class="list-li">
								<div class="text-title text-ellipsis">文章标题</div>
								<div class="article-info"><span>张树荣</span><span>2018-5-14 15:47:01</span></div>
								<div class="float-absolute">
									<input type="radio"class="" name="checkArticle">
								</div>
							</li>-->
						</ul>
					</div>
					<div class="form-group activity-title">
					    <input type="text" id="activityTitle" class="form-control" maxlength="30" placeholder="活动标题（尽量保持和文章标题一致）">
					</div>
			    </div>
		      	<div class="modal-footer">
		        	<button id="saveActivityTile" type="button" class="btn btn-default btn-width120">下一步</button>
		        	<button type="button" class="btn btn-theme btn-width120 save-drafts" data-param="1">保存草稿箱</button>
		      	</div>
		    </div>
	  	</div>
	</div>
	<!-- 红包规则 -->
	<div class="modal fade" id="redPacketModal2" style="overflow-y: auto;" tabindex="-1" role="dialog" aria-labelledby="redPacketModal2Label">
	  	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      	<div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="redPacketModal2Label">设置红包规则</h4>
		     	</div>
			    <div class="modal-body">
		        	<div class="body-center">
		        		<div class="form-horizontal">
		        			<div id="merchantBalance" class="form-group">
							    <label for="totalMoney" class="col-sm-3 control-label text-4f">账户余额：</label>
							    <div class="col-sm-9">
							    	<input type="hidden" name="balance" value="" />
							    	<label class="input-label text-4f">您的账户余额为￥<span class="balance"></span></label>
							    </div>
							</div>
		        			<div class="form-group">
							    <label class="col-sm-3 control-label text-4f-bold">红包金额</label>
							    <div id="moneyType" class="btn-group btn-group-justified col-sm-9 form-tab">
							    	<div class="btn-group" role="group">
										<button type="button" data-param="2" class="btn btn-default active">随机金额</button>
									</div>
									<div class="btn-group" role="group">
										<button type="button" data-param="1" class="btn btn-default">固定金额</button>
									</div>
							    </div>
							</div>
							<div class="form-group">
							    <label id="moneyLabel" for="totalMoney" class="col-sm-3 control-label text-4f">红包总额：</label>
							    <div class="col-sm-9">
							      	<input type="number" id="totalMoney" class="form-control" placeholder="元">
							    </div>
							</div>
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f">单个金额：</label>
							    <div id="moneyInput" class="col-sm-9">
							      	<input type="number" id="minMoney" class="form-control array-input" placeholder="元">
							      	<span class="short-line"></span>
							      	<input type="number" id="maxMoney" class="form-control array-input" placeholder="元">
							      	<!--<input type="text" class="form-control" placeholder="元">-->
							    </div>
							</div>
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f-bold">发放条件</label>
							</div>
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f">奖励地区：</label>
							    <div class="col-sm-9">
							      	<label class="input-label text-4f">选择城市需要用户开启位置，如果用户未开启，则无法收到红包！</label>
							      	<!--<input type="text" class="form-control" placeholder="全国">-->
							    </div>
							</div>
							<div class="btn-group btn-group-justified form-tab bloack-tab">
						    	<div class="btn-group" role="group">
									<button type="button" data-param="0" class="btn btn-default active">不限地址</button>
								</div>
								<div class="btn-group" role="group">
									<button type="button" data-param="1" class="btn btn-default">选择区域</button>
								</div>
								<div class="btn-group" role="group">
									<button type="button" data-param="2" class="btn btn-default">选择坐标</button>
								</div>
						    </div>
							<div id="selectRegion" class="form-group">
								<div class="form-inline" data-toggle="distpicker">
								  <select id="province" class="form-control" data-province="贵州省"></select>
								  <select id="city" class="form-control" data-city="贵阳市"></select>
								  <select id="district" class="form-control" data-district="云岩区"></select>
								</div>	
							</div>	
							<div id="selectCoordinate" class="form-group">
								<div class="baidu-map-btn">
									<input type="text" id="coordinateValue" class="form-control" readonly="readonly" />
									<button type="button" id="confirmAddress" class="btn btn-default">确认地址</button>
									<button type="button" id="restAddress" class="btn btn-default">重新选择</button>
								</div>
								<div id="isShowBaiduMap">
									<input type="text" id="searchAddress" class="form-control" placeholder="输入地址搜索" />
									<!--<div id="r-result"></div>-->
									<div id="baiduMap"></div>
								</div>
							</div>	
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f">转发渠道：</label>
							    <div class="col-sm-9 text-4f">
							      	<label class="checkbox-inline">
									  	<input type="checkbox" name="shareChannel" checked="checked" value="1">转给好友/群
									</label>
									<label class="checkbox-inline">
									  	<input type="checkbox" name="shareChannel" checked="checked" value="2"> 转发朋友圈
									</label>
							    </div>
							</div>
							<div class="form-group" style="margin-bottom: 10px;">
							    <label class="col-sm-3 control-label text-4f">奖励层次：</label>
							    <div class="col-sm-9 text-4f">
							      	<label class="radio-inline">
									  	<input type="radio" name="rewardLevel" value="1"> 只奖励一层人脉
									</label>
									<label class="radio-inline">
									  	<input type="radio" name="rewardLevel" checked="checked" value="2"> 不限制层级
									</label>
							    </div>
							</div>
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f">重复发放：</label>
							    <div class="col-sm-9">
							      	<select id="repeatGrant" class="form-control">
									  	<option value="1">不重复发放</option>
									  	<option value="2">24小时内不重复发放</option>
									  	<option value="3">重复发放</option>
									</select>
							    </div>
							</div>
							<div class="form-group">
							    <label for="brushLimit" class="col-sm-3 control-label text-4f">防刷限制：</label>
							    <div class="col-sm-8">
							      	<input type="number" id="brushLimit" class="form-control" placeholder="人">
							    </div>
							    <a class="col-sm-1 brush-limit">
							    	<img id="showBrushPopover" src="../../img/redPacket/brush-limit.png" />
							    </a>
							    <div id="brushPopover" class="brush-popover">
									当用户下一级转发超过设置的人数时，视为存在刷单嫌疑， 并对其所有下级人员停止发放红包
								</div>
							</div>
							<div class="form-group">
							    <label for="shareArticleNum" class="col-sm-3 control-label text-4f">分享次数：</label>
							    <div class="col-sm-8">
							      	<input type="number" id="shareArticleNum" class="form-control" value="1" placeholder="1">
							    </div>
							</div>
							<div class="form-group">
							    <label class="col-sm-3 control-label text-4f-bold">活动时间</label>
							</div>
							<div class="form-group">
							    <label for="activityStartTime" class="col-sm-3 control-label text-4f">开始时间：</label>
							    <div class="col-sm-9">
							      	<input size="16" type="text" id="activityStartTime" value="" readonly class="form_datetime">
							    </div>
							</div>
							<div class="form-group">
							    <label for="activityEndTime" class="col-sm-3 control-label text-4f">结束时间：</label>
							    <div class="col-sm-9">
							      	<input size="16" type="text" id="activityEndTime" value="" readonly class="form_datetime">
							    </div>
							</div>
							<div class="form-group">
							    <label for="redPackDescribe" class="col-sm-3 control-label text-4f">领取红包描述：</label>
							    <div class="col-sm-9">
							      	<input type="text" id="redPackDescribe" class="form-control" value="亲！请分享文章给好友（朋友群、朋友圈）领取红包哦~" placeholder="亲！请分享文章给好友（朋友群、朋友圈）领取红包哦~">
							    </div>
							</div>
		        		</div>	
		        	</div>
			    </div>
		      	<div class="modal-footer">
		        	<button id="lastActivityTitle" type="button" class="btn btn-default btn-width120">上一步</button>
		        	<button id="saveActivityRules" type="button" class="btn btn-default btn-width120">下一步</button>
		        	<button type="button" class="btn btn-theme btn-width120 save-drafts" data-param="2">保存草稿箱</button>
		      	</div>
		    </div>
	  	</div>
	</div>
	<!-- 红包续费Modal -->
	<div class="modal fade" id="redPacketRenewModal" tabindex="-1" role="dialog" aria-labelledby="redPacketRenewModalLabel">
	  	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      	<div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="redPacketRenewModalLabel">红包活动续费</h4>
		     	</div>
			    <div class="modal-body">
		        	<div class="renew-list">
		        		<ul class="list-ul">
		        			<li class="list-li">
		        				<div class="font-row space-between text-66">
			        				<span id="typeSpan">红包类型：</span>
			        				<span id="singleAmountSpan">单个金额：</span>
		        				</div>
		        			</li>
		        			<li class="list-li">
		        				<div class="font-row space-between text-66">
			        				<span id="grantNumSpan">已发红包： （个）</span>
			        				<span id="grantPriceSpan">发出金额： ¥</span>
		        				</div>
		        			</li>
		        			<li class="list-li">
		        				<div class="font-row space-between text-66">
			        				<span id="surplusPriceSpan">活动余额：¥</span>
		        				</div>
		        			</li>
		        			<li class="list-li">
		        				<div class="form-group">
								    <label for="addActivityMoney" class="col-sm-3 control-label text-4f">添加活动金额：</label>
								    <div class="col-sm-8">
								      	<input type="number" id="addActivityMoney" class="form-control" placeholder="请输入金额">
								    </div>
								</div>
		        			</li>
		        		</ul>
		        		<div class="top-up text-66">
		        			<p>本次增加活动金额为<span id="showAddActivityMoney" style="color: red;"></span>元</p>
		        			<p>请确保您的微信商户中有充足的余额，<a href="https://pay.weixin.qq.com/index.php/core/home/login?return_url=%2F" class="text-11B5AB" target="_blank">点此充值</a></p>
		        		</div>
		        	</div>
			    </div>
		      	<div class="modal-footer">
		        	<button type="button" class="btn btn-default btn-width120" data-dismiss="modal">取消</button>
		        	<button type="button" id="saveRedPackRenew" class="btn btn-theme btn-width120">确定</button>
		      	</div>
		    </div>
	  	</div>
	</div>
	<!--红包封面MODEL-->
	<div class="modal fade" id="redPacketModal3" tabindex="-1" role="dialog" aria-labelledby="redPacketModal3Label">
	  	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      	<div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="redPacketModal3Label">设置红包封面</h4>
		     	</div>
			    <div class="modal-body">
		        	<div class="the-cover">
		        		<div class="words-limit">
						    <input id="activityName" type="text" maxlength="10" class="form-control input-words" open-data="activityName" placeholder="活动名称">
						    <span class="number-words"><span>0</span>/10</span>
						</div>
						<div class="words-limit">
						    <input id="merchantsName" type="text" maxlength="10" class="form-control input-words" open-data="merchantsName" placeholder="商户名称">
						    <span class="number-words"><span>0</span>/10</span>
						</div>
						<div class="words-limit">
						    <input id="sentiment" type="text" maxlength="20" class="form-control input-words" open-data="sentiment" placeholder="祝福语">
						    <span class="number-words"><span>0</span>/20</span>
						</div>
						<div class="red-packet-preview space-between">
							<div class="goods-preview">
								<div class="title">商户名称</div>
								<div class="body">
									<p>你收到了一个红包</p>
									<h6 class="text-8e">2月14日</h6>
									<p class="edit-preview">你参与<span class="text-8e activityName"></span>，成功获得<span class="text-8e merchantsName"></span>赠送的红包。</p>
									<p>点击拆开红包即可获得现金</p>
								</div>
								<div class="footer text-11B5AB">详情&nbsp;>></div>
							</div>
							<div class="red-preview">
								<p class="preview-font merchantsName"></p>
								<p class="sentiment"></p>
							</div>
						</div>
		        	</div>
			    </div>
		      	<div class="modal-footer">
		        	<button type="button" class="btn btn-default btn-width120 save-drafts" data-param="3">保存草稿</button>
		        	<button id="lastActivityRules" type="button" class="btn btn-default btn-width120">上一步</button>
		        	<button id="saveRedPacket" type="button" class="btn btn-theme btn-width120">创建完成</button>
		      	</div>
		    </div>
	  	</div>
	</div>
	<!--红包充值MODEL-->
	<div class="modal fade bs-example-modal-lg" id="rechargeModel" tabindex="-1" role="dialog" aria-labelledby="rechargeModelLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
			    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			    	<h4 class="modal-title" id="rechargeModelLabel">红包充值</h4>
				</div>
			  	<div class="modal-body">
			  		<div class="recharge-money">
			  			<div class="recharge-money-btn">
			  				<div class="recharge-btn">
			  					<button type="button" class="btn btn-default">100</button>
			  					<button type="button" class="btn btn-default">300</button>
			  					<button type="button" class="btn btn-default">500</button>
			  				</div>
			  				<div class="recharge-btn">
			  					<button type="button" class="btn btn-default">1000</button>
			  					<button type="button" class="btn btn-default">2000</button>
			  					<button type="button" class="btn btn-default">5000</button>
			  				</div>
			  			</div>
			  			<div class="recharge-input">
			  				<span>充值</span><input type="number" id="fillMoney" class="form-control" placeholder="手填金额需大于1000且为100倍数" /><span>元</span>
			  			</div>
			  			<div class="recharge-prompt">
			  				<a href="http://www.chinatax.gov.cn/n810341/n810765/n812156/n812484/c1186849/content.html" target="_blank">国家税务总局-> 财税2011【50】第二条第一点的规定</a>，企业在业务宣传、广告等活动中，随机向本单位以外的个人赠送礼品（红包所属为礼品），对个人取得的礼品所得，按照“其他所得”项目，全额适用20%的税率缴纳个人所得税；也就是说，你要对外发1000元红包，加上代扣代缴的费用200元， 实际成本是1200元，同时微信公司需要收取0.6%的手续费，所以你的税率为：20%+0.6%=20.6%。例如：你需要发100元红包。你实际支付的费用为：100  x （1+20.6%）= 120.6
			  			</div>
			  			<div class="recharge-pay-btn">
			  				<button type="button" id="createQRcode" class="btn btn-default btn-block btn-theme">生成支付二维码</button>
			  			</div>
			  		</div>
			  		<div class="recharge-code">
			  			<div class="wepay-logo">
			  				<img src="../../img/redPacket/wePayLogo.png" />
			  			</div>
			  			<div class="recharge-qrcode"></div>
			  			<div class="wepay-prompt">
			  				<img src="../../img/redPacket/wepay-prompt.png" />
			  			</div>
			  		</div>
			  	</div>
			</div>
		</div>
	</div>
	<!--预览model-->
	<div class="modal fade bs-example-modal-lg" id="previewModel" tabindex="-1" role="dialog" aria-labelledby="previewLabel">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
				<div class="modal-header">
			    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			    	<h4 class="modal-title" id="previewLabel">预览</h4>
				</div>
			  	<div class="modal-body">
			  		<div class="preview-content">
				    	<div class="phone-model">
				    		<div class="phone-content">
				    			<div id="previewArticle" class="refresh-scroll">
					    			<!--<p class="phone-title">标题</p>
					    			<h6>2018-5-7 <a>张三丰</a></h6>
					    			<div class="phone-body">
	                            	    
					    			</div>-->
								</div>
								<!--报名-->
								<nav class="mui-bar mui-bar-tab enroll-tab">
									<div class="title-item">
										报名信息防静电索拉卡
									</div>
									<div class="btn-item">
										<button type="button" class="mui-btn btn-theme">立即报名</button>
									</div>
								</nav>
								<!--报名-->
								<nav class="mui-bar mui-bar-tab tickets-tab">
									<div class="title-item">
										报名信息防静电索拉卡
									</div>
									<div class="btn-item">
										<button type="button" class="mui-btn btn-theme">立即领票</button>
									</div>
								</nav>
								<!--名片插件管理-->
								<nav class="mui-bar mui-bar-tab card-tab">
									<div class="user-item">
										<!--<a class="head-img">
											<img src="../../img/login/logo.png" />	
										</a>
										<div class="user-info-bar">
											<span class="name">张三丰</span><span class="position">销售总监</span><br />
											<a class="phone" href="tel:">1383838438</a>
										</div>-->
									</div>
									<div class="icon-item qrcode-item customer-wechat-click">
										<img src="../../img/phone/wechat-icon.png" />
									</div>
									<a class="icon-item phone-item customer-phone-click" href="#">
										<img src="../../img/phone/phone-icon.png" />
									</a>
								</nav>
								<!--名片和报名和门票-->
								<nav class="mui-bar mui-bar-tab merge-tab">
									<div class="merge-user-item">
										<!--<a class="head-img">
											<img src="../../img/login/logo.png" />	
										</a>
										<div class="user-info-bar">
											<span class="name">用户名字</span><span class="position">销售总监</span><br />
											<a class="phone" href="tel:18685306265">18685306265</a>
										</div>-->
									</div>
									<div class="icon-item merge-qrcode-item customer-wechat-click">
										<img src="../../img/phone/wechat-icon.png" />
									</div>
									<div class="icon-item merge-enroll-item">
										<!--<span class="text-11B5AB">报名</span>-->
									</div>
									<div class="icon-item merge-ticket-item">
										<!--<span class="text-11B5AB">领票</span>-->
									</div>
								</nav>
				    		</div>
				    	</div>
				    	<div class="scan-wechat">
				    		<div class="preview-qrcode">
				    			<div class="qrcode"></div>
				    			<div class="prompt">
				    				微信扫一扫，开始分享
				    			</div>
				    		</div>
				    		<div class="wechat-share">
				    			<!--<div class="wechat-title text-ellipsis"></div>
				    			<div class="wechat-content">
				    				<div class="wechat-describe"></div>
				    				<div class="wechat-icon">
				    					<img src="../../img/HBuilder.png"/>
				    				</div>
				    			</div>-->
				    		</div>
				    	</div>
			    	</div>
			  	</div>
			</div>
		</div>
	</div>
	<div class="modal fade" id="rechargeModal" tabindex="-1" role="dialog" aria-labelledby="rechargeModalLabel">
	  	<div class="modal-dialog" role="document">
		    <div class="modal-content">
		      	<div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			        <h4 class="modal-title" id="rechargeModalLabel">红包充值记录</h4>
		     	</div>
			    <div class="modal-body">
		        	<div style="margin-top: 20px;" class="table-list">
						<!--<div class="table-btn">
							<button id="exportTable" class="btn btn-default" type="button">导出表格</button>
						</div>-->
						<table class="table table-bordered table-hover table-striped">
							<thead>
								<tr>
									<th>充值金额</th>
									<th>充值时间</th>
								</tr>
							</thead>
							<tbody>
								<!--<tr>
									<td>100</td>
									<td>2018-7-12 17:38:00</td>
								</tr>-->
							</tbody>
						</table>
						<nav id="rechargeModalPage" class="text-center" aria-label="Page navigation">
							<ul class="pagination">
							</ul>
						</nav>
					</div>
			    </div>
		    </div>
	  	</div>
	</div>
	<script type="text/javascript" src="../../js/utils/jquery-1.12.4.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.fr.js" ></script>
	<script type="text/javascript" src="../../js/utils/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
	<script type="text/javascript" src="../../js/utils/jquery.cookie.js" ></script>
	<script type="text/javascript" src="../../js/utils/toastr.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/mui.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/jquery.qrcode.min.js" ></script>
	<script type="text/javascript" src="../../js/utils/page.js" ></script>
	<script type="text/javascript" src="../../js/utils/distpicker.data.js" ></script>
	<script type="text/javascript" src="../../js/utils/distpicker.js" ></script>
	<script type="text/javascript" src="../../js/utils/main.js" ></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=bqe53j1ZV1xUA3NvSMYYDWPbwp3WjYOU"></script>
	<script type="text/javascript" src="../../js/utils/regular.js" ></script>
	<script type="text/javascript" src="../../js/utils/boot.js" ></script>
	<script>
		var userID,companyID,redPackTitle,pageNum=1,roleType;
		var articleKeyword,articleType=1,articlePageNum=0;
		var isBaiduMap = true,resultLocal;
		var isPublish = 0;//是否发布 0=保存草稿箱；1=发布
		var rechargePageNo = 1;
		$(function(){
			userID = $.cookie("userID");
			companyID = $.cookie("companyID");
			roleType = $.cookie("roleType");
			toastr.options = {
                "timeOut": 2000,
                "positionClass": "toast-middle-center"
            };
            if (roleType != 1) {
            	$("#rechargeMoneyRecord").show();
            }
			initRedPacketList();
			initRefresh();
		});
		function initRedPacketList(){
			var data = {
				userID:userID,
				companyID:companyID,
				redPackTitle:redPackTitle,
				roleType:roleType,
				pageNo:pageNum
			}
			base.postData(base.url.getRedPackList, data, callbackGetRedPackList);
		}
		function callbackGetRedPackList(data){
			if (data.success) {
				var html = "";
				for (var i=0; i<data.context.redPackList.length; i++) {
					html += pingRedPacketList(data.context.redPackList[i]);
				}
				$(".row-list").html(html);
				if (pageNum == 1){
					//初始化分页
					var totalPage = Math.ceil(data.context.totalPage/8);
					var page = {
						pageIndex:1,//初始页数
						currentPage:1,//当前页
						showPage:5,//显示页数
						totalPage:totalPage,//总页数
						onPageClick: function(page) {
							$("#page").initPage(page);
							pageNum = page.currentPage;
							initRedPacketList();
			    			return false;  //默认的翻页事件
					    }
					};
					$("#page").initPage(page);
				}
			}
		}
		function pingRedPacketList(data){
			var html = '<div class="col-sm-6 col-lg-3">'+
						'	<div class="thumbnail">'+
						'		<input type="hidden" name="redPackID" value="'+data.redPackID+'" />'+
						'		<input type="hidden" name="articleID" value="'+data.articleID+'" />'+
						'		<div class="img-layer">'+
						'			<div class="floating-layer">'+
						'				<div class="float-btn">'+
						'					<p><button class="btn btn-default activity-info" type="button">活动详情</button></p>'+
						'					<p><button class="btn btn-default preview-model" type="button">预&nbsp;&nbsp;览</button></p>'+
						'				</div>';
						if (data.status != 2){
				html += '				<div class="float-bottom space-between">'+
						'					<div data-param="2" class="img-btn red-packet-status">'+
						'						<img src="../../img/redPacket/stop.png" /><span>结束</span>'+
						'					</div>';
						if (data.status == 0) {
				html += '					<div data-param="1" class="img-btn red-packet-status">'+
						'						<img src="../../img/redPacket/suspend.png" /><span>暂停</span>'+
						'					</div>';
						}else if (data.status == 1) {
				html += '					<div data-param="0" class="img-btn red-packet-status">'+
						'						<img src="../../img/redPacket/play.png" /><span>开启</span>'+
						'					</div>';			
						}
				html += '					<div class="img-btn renew-money">'+
						'						<img src="../../img/redPacket/recharge.png" /><span>追加红包</span>'+
						'					</div>'+
						'				</div>';
						}
				html += '			</div>';
						if (data.status == 0) {
				html += '			<div class="float-status status-go"></div>';			
						}else if (data.status == 1) {
				html += '			<div class="float-status status-pause"></div>';			
						}else if (data.status == 2) {
				html += '			<div class="float-status status-end"></div>';			
						}
				html += '			<div class="text-title text-ellipsis">'+data.redPackTitle+'</div>'+
						'			<div class="text-8b">开始时间：'+data.startTime+'</div>'+
						'			<div class="text-8b">结束时间：'+data.endTime+'</div>'+
						'			<div class="division-line"></div>'+
						'			<div class="space-between text-8b img-span">'+
						'				<div><img src="../../img/myExtension/content-read.png" /><span>'+data.readNum+'</span></div>'+
						'				<div><img src="../../img/myExtension/content-share.png" /><span>'+data.shareNum+'</span></div>'+
						'				<div><img src="../../img/myExtension/content-praise.png" /><span>'+data.likeNum+'</span></div>'+
						'			</div>'+
						'		</div>'+
						'		<div class="caption space-between">'+
						'			<div class="red-packet-price text-8b">'+
						'				<img src="../../img/redPacket/packet-num.png" /><span>'+data.redPackNum+'个</span><img src="../../img/redPacket/price.png" /><span>'+data.grantRedPackSun+' / '+data.redPackSum+'</span>'+
						'			</div>'+
						'			<div><a href="javascript:void(0)" onclick="javascript:window.parent.location=\'../index.html?path=redPacket/redPacketDetails.html?redPackID='+data.redPackID+'\'">红包明细</a></div>'+
						'		</div>'+
						'	</div>'+
						'</div>';
			return html;
		}
		$("#searchRedPacket").bind('keyup', function(event) {
			if (event.keyCode == "13") {
		　　　　//回车执行查询
				$(this).blur();
				redPackTitle = $(this).val();
				pageNum = 1;
				initRedPacketList();
		　　	}
		});
		//鼠标悬浮
		$(".row-list").on("mouseover mouseout", ".thumbnail", function(event){
			if(event.type == "mouseover"){
				//鼠标悬浮
				$(this).find(".floating-layer").css("opacity", "1");
			}else if(event.type == "mouseout"){
				//鼠标离开
				$(this).find(".floating-layer").css("opacity", "0");
			}
		});
		function initRefresh(){
			mui.init({
				pullRefresh: {
					container: '#pullrefresh',
					up: {
						auto:true,
						contentrefresh: '正在加载...',
						callback: pullupRefresh
					}
				}
			});
		}
		function pullupRefresh() {
			mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //参数为true代表没有更多数据了。
			if (articlePageNum == 0) {
				articlePageNum++;
			}else{
				articlePageNum++;
				initArticleList();	
			}
			
		}
		function initArticleList(){
			var data = {
				userID:userID,
				companyID:companyID,
				keyword:articleKeyword,
				type:articleType,
				pageNo:articlePageNum
			}
			base.postData(base.url.getArticleList, data, callbackGetArticleList);
		}
		function callbackGetArticleList(data) {
			if (data.success) {
				var html = "";
				if (data.context.myArticleList.length == 0) {
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //参数为true代表没有更多数据了。
				}
				for (var i=0; i<data.context.myArticleList.length; i++) {
					html += '<li class="list-li">'+
							'	<div style="padding-right:40px;" class="text-title text-ellipsis">'+data.context.myArticleList[i].title+'</div>'+
							'	<div class="article-info"><span>'+data.context.myArticleList[i].userName+'</span><span>'+data.context.myArticleList[i].alterTime+'</span></div>'+
							'	<div class="float-absolute">'+
							'		<input type="radio" class="" data-param="'+data.context.myArticleList[i].title+'" name="checkArticle" value="'+data.context.myArticleList[i].articleId+'">'+
							'	</div>'+
							'</li>';
				}
				if (articlePageNum == 1) {
					$("#pullrefresh .list-ul").html(html);
				}else{
					$("#pullrefresh .list-ul").append(html);	
				}
			}else {
				toastr.warning(data.msg);
			}
		}
		//新建红包
		$("#createRedpacket").click(function(){
			articleKeyword = "";
			articlePageNum=1;
			mui('#pullrefresh').pullRefresh().enablePullupToRefresh();
			$("#pullrefresh .list-ul").html('<div style="text-align:center;margin-top:20px;color:#666666">正在加载推文。。。</div>');
			$("#pullrefresh .list-ul").css("transform","translate3d(0px, 0px, 0px) translateZ(0px)");
			mui('#pullrefresh').pullRefresh().refresh(true);
			initArticleList();
			
			//初始化输入框
			$('.modal-dialog .modal-body').find("input").removeAttr("disabled");
			$('.modal-dialog .modal-body').find("select").removeAttr("disabled");
			$('.modal-dialog .modal-body').find("button").removeAttr("disabled");
			$(".modal-dialog .modal-footer").find(".save-drafts").show();
			$("#saveRedPacket").show();
			//红包标题
			$("#activityTitle").val("");
			$("#articleAndTask").find(".btn").removeClass("active");
			$("#articleAndTask").find(".btn").each(function(){
				if ($(this).attr("data-param") == 1) {
					$(this).addClass("active");
				}
			});
			//红包规则
			$("#moneyType").find(".btn").removeClass("active");
			$("#moneyType").find(".btn").each(function(){
				if ($(this).attr("data-param") == 2) {
					$(this).addClass("active");
				}
			});
			$("#moneyLabel").html("红包总额：");
			$("#totalMoney").val("").attr("placeholder", "元");
			var html = '<input type="number" id="minMoney" class="form-control array-input" placeholder="元">'+
				       '<span class="short-line"></span>'+
				       '<input type="number" id="maxMoney" class="form-control array-input" placeholder="元">';
			$("#moneyInput").html(html);
			$(".bloack-tab").find(".btn").removeClass("active");
			$(".bloack-tab").find(".btn").each(function(){
				if ($(this).attr("data-param") == 0) {
					$(this).addClass("active");
				}
			});		
			$("#selectRegion").hide();
			$("#selectCoordinate").hide();
			$("#coordinateValue").val();
			$("input[name='shareChannel']").prop("checked","checked"); 
			$("input[name='rewardLevel']").removeAttr("checked");
			$("input[name='rewardLevel']").each(function(){
				if ($(this).val() == 2) {
					$(this).prop("checked", true);
				}
			});
			$("#repeatGrant").val(1);
			$("#brushLimit").val("");
			$("#shareArticleNum").val(1);
			$("#redPackDescribe").val("亲！请分享文章给好友（朋友群、朋友圈）领取红包哦~");			
			$("#activityStartTime").val("");
			$("#activityEndTime").val("");
			//红包封面
			$("#activityName").val("");
			$("#merchantsName").val("");
			$("#sentiment").val("");
			$(".activityName").text("");
			$(".merchantsName").text("");
			$(".sentiment").text("");
			
			$('#redPacketModal1').modal('show');
		});
		$("#searchArticle").bind('keyup', function(event) {
			if (event.keyCode == "13") {
		　　　　//回车执行查询
				$(this).blur();
				articleKeyword = $(this).val();
				articlePageNum=1;
				$("#pullrefresh .list-ul").css("transform","translate3d(0px, 0px, 0px) translateZ(0px)");
				mui('#pullrefresh').pullRefresh().refresh(true);
				initArticleList();
		　　	}
		});
		$("#articleAndTask").on("click", "button", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}
			$("#articleAndTask button").removeClass("active");
			$(this).addClass("active");
			articleType = $(this).attr("data-param");
			articlePageNum=1;
			initArticleList();
		});
		$("#pullrefresh .list-ul").on("change", "input[name='checkArticle']", function(){
			if ($(this).prop("checked")) {
				$("#activityTitle").val($(this).attr("data-param"));				
			}
		});
		//续费model显示
		var renewRedPackID;
		$(".row-list").on("click", ".renew-money", function() {
			renewRedPackID = $(this).closest(".thumbnail").find("input[name='redPackID']").val();
			base.postData(base.url.getRedPackAmount, {userID:userID,companyID:companyID,redPackID:renewRedPackID}, callbackGetRedPackAmount);
		});
		function callbackGetRedPackAmount(data){
			if (data.success) {
				$('#redPacketRenewModal .modal-dialog .modal-body').find("input").removeAttr("disabled");
				$('#redPacketRenewModal').modal('show');
				$("#typeSpan").html("红包类型："+(data.context.type==1?"固定金额":"随机金额"));
				$("#singleAmountSpan").html("单个金额："+data.context.singleAmount);
				$("#grantNumSpan").html("已发红包： "+data.context.grantNum+"（个）");
				$("#grantPriceSpan").html("发出金额： ¥"+data.context.grantPrice);
				$("#surplusPriceSpan").html("活动余额：¥"+data.context.surplusPrice);
			}
		}
		$("#addActivityMoney").on("keyup", function(){
			$("#showAddActivityMoney").html($(this).val());
		});
		$("#saveRedPackRenew").click(function(){
			var redPackSum = $("#addActivityMoney").val();
			base.postData(base.url.addRedPackRenew, {userID:userID,companyID:companyID,redPackID:renewRedPackID,roleType:roleType,redPackSum:redPackSum}, callbackAddRedPackRenew);
		});
		function callbackAddRedPackRenew(data){
			if (data.success) {
				toastr.success("续费成功");
				$('#redPacketRenewModal').modal('hide');
			}else{
				toastr.warning("续费失败");
			}
		}
		//红包规则model显示
		$("#saveActivityTile").click(function(){
			var activityTitle = $("#activityTitle").val();
			var checkArticle = $("input[name='checkArticle']:checked").val();
			if (activityTitle == null || activityTitle == "") {
				toastr.warning("活动标题不能为空");
				return;
			}
			if (checkArticle == null || checkArticle == "") {
				toastr.warning("请选择要加持的文章");
				return;
			}
			if (roleType != 1) {
				base.postData(base.url.getMerchantInfo, {userID:userID,companyID:companyID}, callbackGetMerchantInfo);
			}
			$('#redPacketModal1').modal('hide');
			$('#redPacketModal2').modal('show');
			initDateTime();
			if (isBaiduMap) {
				isBaiduMap = false;
				initBaiduMap();
			}
		});
		function callbackGetMerchantInfo(data){
			if (data.success) {
				$("#merchantBalance").show();
				$("#merchantBalance input[name='balance']").val(data.context.price);
				$("#merchantBalance .balance").text(data.context.price);
			}
		}
		//红包规则页面上一步
		$("#lastActivityTitle").click(function(){
			$('#redPacketModal1').modal('show');
			$('#redPacketModal2').modal('hide');
		});
		//红包封面页面上一步
		$("#lastActivityRules").click(function(){
			$('#redPacketModal2').modal('show');
			$('#redPacketModal3').modal('hide');
		});
		//红包封面model显示
		$("#saveActivityRules").click(function(){
			if (checkRules()) {
				return;
			}
			$('#redPacketModal2').modal('hide');
			$('#redPacketModal3').modal('show');
		});
		function checkRules(){
			var moneyType = $("#moneyType").find(".btn.active").attr("data-param");
			var totalMoney = $("#totalMoney").val();
			//红包金额限制
			if (moneyType == 2) {//随机金额
				if (totalMoney == null || totalMoney == "" || parseInt(totalMoney) <= 0) {
					toastr.warning("红包总额不能小于0");
					return true;
				}
				if (roleType != 1 && parseFloat(totalMoney) > parseFloat($("#merchantBalance input[name='balance']").val())) {
					toastr.warning("红包总额不能大于账户余额");
					return true;
				}
				if ($("#minMoney").val() == "" || $("#maxMoney").val() == "") {
					toastr.warning("单个金额不能为空");
					return true;
				}
				if (parseFloat($("#minMoney").val()) <= 0 || parseFloat($("#maxMoney").val()) <= 0) {
					toastr.warning("单个金额不能小于0");
					return true;
				}
				if (parseFloat($("#maxMoney").val()) < parseFloat($("#minMoney").val())) {
					toastr.warning("单个金额最大值不能小于最小值");
					return true;
				}
				if (parseFloat(totalMoney) < parseFloat($("#maxMoney").val())) {
					toastr.warning("红包总额不能小于单个金额最大值");
					return true;
				}
			}else if (moneyType == 1) {//固定金额
				if (!checkIntNum(totalMoney) || totalMoney <= 0) {
					toastr.warning("红包个数不能小于0且为正整数");
					return true;
				}
				if ($("#singleMoney").val() == "" || parseInt($("#singleMoney").val()) <= 0) {
					toastr.warning("单个金额不能小于0");
					return true;
				}
				if (roleType != 1 && parseFloat(totalMoney * $("#singleMoney").val()) > parseFloat($("#merchantBalance input[name='balance']").val())) {
					toastr.warning("红包总额不能大于账户余额");
					return true;
				}
			}
			//区域限制
			var areaType = $(".bloack-tab").find(".btn.active").attr("data-param");
			if (areaType == 1) {//选择区域
				if ($("#province").val() == null || $("#province").val() == "") {
					toastr.warning("请选择区域");
					return true;
				}
			}else if (areaType == 2) {
				if ($("#coordinateValue").val() == null || $("#coordinateValue").val() == "") {
					toastr.warning("请选择坐标");
					return true;
				}
			}
			//转发渠道限制
			var shareChannel = $("input:checked[name='shareChannel']:checked").map(function(index,elem){
				return $(elem).val();
			}).get().join(",");
			if (shareChannel == null || shareChannel == "") {
				toastr.warning("请选择转发渠道");
				return true;
			}
			if ($("#brushLimit").val() != "" && $("#brushLimit").val() <= 0) {
				toastr.warning("防刷限制不能小于0");
				return true;
			}
			//红包活动时间限制
			if ($("#activityStartTime").val() == null || $("#activityStartTime").val() == "") {
				toastr.warning("活动开始时间不能为空");
				return true;
			}
			if ($("#activityEndTime").val() == null || $("#activityEndTime").val() == "") {
				toastr.warning("活动结束时间不能为空");
				return true;
			} 
			if (CompareDate($("#activityStartTime").val(),$("#activityEndTime").val())) {
				toastr.warning("活动开始时间不能大于结束时间");
				return true;
			}
		}
		$("#saveRedPacket").click(function(){
			var activityName = $("#activityName").val();
			var merchantsName = $("#merchantsName").val();
			var sentiment = $("#sentiment").val();
			if (activityName == null || activityName == "") {
				toastr.warning("活动名称不能为空");
				return;
			}
			if (merchantsName == null || merchantsName == "") {
				toastr.warning("商户名称不能为空");
				return;
			}
			if (sentiment == null || sentiment == "") {
				toastr.warning("祝福语不能为空");
				return;
			}
			var rewardArea = $("#province").val() + "," + $("#city").val() + "," + $("#district").val();
			var lon,lat;
			if ($("#coordinateValue").val() != null && $("#coordinateValue").val() != "") {
				lon = $("#coordinateValue").val().split(",")[0];
				lat = $("#coordinateValue").val().split(",")[1];
			}
			var shareChannel = $("input:checked[name='shareChannel']:checked").map(function(index,elem){
				return $(elem).val();
			}).get().join(",");
			isPublish = 1;
			var data = {
				userID:userID,
				companyID:companyID,
				isPublish:isPublish,//发布
				roleType:roleType,
				redPackType:$("#articleAndTask").find(".btn.active").attr("data-param"),
				articleID:$("input[name='checkArticle']:checked").val(),
				redPackTitle:$("#activityTitle").val(),
				type:$("#moneyType").find(".btn.active").attr("data-param"),
				redPackNum:$("#totalMoney").val(),
				singleAmount:$("#singleMoney").val(),
				redPackSum:$("#totalMoney").val(),
				minAmount:$("#minMoney").val(),
				maxAmount:$("#maxMoney").val(),
				areaType:$(".bloack-tab").find(".btn.active").attr("data-param"),
				rewardArea:rewardArea,
				lon:lon,
				lat:lat,
				shareChannel:shareChannel,
				rewardLevel:$("input[name='rewardLevel']:checked").val(),
				repeatGrant:$("#repeatGrant").val(),
				brushLimit:$("#brushLimit").val(),
				startTime:$("#activityStartTime").val(),
				endTime:$("#activityEndTime").val(),
				shareArticleNum:$("#shareArticleNum").val(),
				redPackDescribe:$("#redPackDescribe").val(),
				activityName:activityName,
				merchantName:merchantsName,
				wish:sentiment
			}
			base.postData(base.url.addRedPack, data, callbackAddRedPack);
		});
		$(".save-drafts").click(function(){
			isPublish = 0;
			var draftsType = $(this).attr("data-param");
			var activityTitle = $("#activityTitle").val();
			var checkArticle = $("input[name='checkArticle']:checked").val();
			if (activityTitle == null || activityTitle == "") {
				toastr.warning("活动标题不能为空");
				return;
			}
			if (checkArticle == null || checkArticle == "") {
				toastr.warning("请选择要加持的文章");
				return;
			}
			if (draftsType == 1) {
				var data = {
					userID:userID,
					companyID:companyID,
					isPublish:isPublish,
					redPackType:$("#articleAndTask").find(".btn.active").attr("data-param"),
					articleID:checkArticle,
					redPackTitle:activityTitle
				}
				base.postData(base.url.addRedPack, data, callbackAddRedPack);
				return;
			}
			if (checkRules()) {
				return;
			}
			var rewardArea = $("#province").val() + ',' + $("#city").val() + ',' + $("#district").val();
			var lon,lat;
			if ($("#coordinateValue").val() != null && $("#coordinateValue").val() != "") {
				lon = $("#coordinateValue").val().split(",")[0];
				lat = $("#coordinateValue").val().split(",")[1];
			}
			var shareChannel = $("input:checked[name='shareChannel']:checked").map(function(index,elem){
				return $(elem).val();
			}).get().join(",");
			if (draftsType == 2) {
				var data = {
					userID:userID,
					companyID:companyID,
					isPublish:isPublish,//发布
					redPackType:$("#articleAndTask").find(".btn.active").attr("data-param"),
					articleID:checkArticle,
					redPackTitle:activityTitle,
					type:$("#moneyType").find(".btn.active").attr("data-param"),
					redPackNum:$("#totalMoney").val(),
					singleAmount:$("#singleMoney").val(),
					redPackSum:$("#totalMoney").val(),
					minAmount:$("#minMoney").val(),
					maxAmount:$("#maxMoney").val(),
					areaType:$(".bloack-tab").find(".btn.active").attr("data-param"),
					rewardArea:rewardArea,
					lon:lon,
					lat:lat,
					shareChannel:shareChannel,
					rewardLevel:$("input[name='rewardLevel']:checked").val(),
					repeatGrant:$("#repeatGrant").val(),
					brushLimit:$("#brushLimit").val(),
					startTime:$("#activityStartTime").val(),
					endTime:$("#activityEndTime").val(),
					shareArticleNum:$("#shareArticleNum").val(),
					redPackDescribe:$("#redPackDescribe").val()
				}
				base.postData(base.url.addRedPack, data, callbackAddRedPack);
				return;
			}
			var activityName = $("#activityName").val();
			var merchantsName = $("#merchantsName").val();
			var sentiment = $("#sentiment").val();
			if (activityName == null || activityName == "") {
				toastr.warning("活动名称不能为空");
				return;
			}
			if (merchantsName == null || merchantsName == "") {
				toastr.warning("商户名称不能为空");
				return;
			}
			if (sentiment == null || sentiment == "") {
				toastr.warning("祝福语不能为空");
				return;
			}
			if (draftsType == 3) {
				var data = {
					userID:userID,
					companyID:companyID,
					isPublish:isPublish,//发布
					redPackType:$("#articleAndTask").find(".btn.active").attr("data-param"),
					articleID:checkArticle,
					redPackTitle:activityTitle,
					type:$("#moneyType").find(".btn.active").attr("data-param"),
					redPackNum:$("#totalMoney").val(),
					singleAmount:$("#singleMoney").val(),
					redPackSum:$("#totalMoney").val(),
					minAmount:$("#minMoney").val(),
					maxAmount:$("#maxMoney").val(),
					areaType:$(".bloack-tab").find(".btn.active").attr("data-param"),
					rewardArea:rewardArea,
					lon:lon,
					lat:lat,
					shareChannel:shareChannel,
					rewardLevel:$("input[name='rewardLevel']:checked").val(),
					repeatGrant:$("#repeatGrant").val(),
					brushLimit:$("#brushLimit").val(),
					startTime:$("#activityStartTime").val(),
					endTime:$("#activityEndTime").val(),
					shareArticleNum:$("#shareArticleNum").val(),
					redPackDescribe:$("#redPackDescribe").val(),
					activityName:activityName,
					merchantName:merchantsName,
					wish:sentiment
				}
				base.postData(base.url.addRedPack, data, callbackAddRedPack);
			}
		});
		function callbackAddRedPack(data){
			if (data.success) {
				$('#redPacketModal1').modal('hide');
				$('#redPacketModal2').modal('hide');
				$('#redPacketModal3').modal('hide');
				if (isPublish == 0) {
					toastr.success("保存草稿箱成功");
				}else{
					toastr.success("新建红包活动成功");	
					redPackTitle="";
					pageNum = 1;
					initRedPacketList();
				}
			}else{
				toastr.warning(data.msg);
			}
		}
		//点击活动详情
		$(".row-list").on("click", ".activity-info", function() {
			var redPackID = $(this).closest(".thumbnail").find("input[name='redPackID']").val();
			base.postData(base.url.getRedPackInfo, {redPackID:redPackID}, callbackGetRedPackInfo);
		});
		function callbackGetRedPackInfo(data) {
			if (data.success) {
				//红包标题
				$("#activityTitle").val(data.context.redPackTitle);
				$("#articleAndTask").find(".btn").removeClass("active");
				$("#articleAndTask").find(".btn").each(function(){
					if ($(this).attr("data-param") == data.context.redPackType) {
						$(this).addClass("active");
					}
				});
				var html = '<li class="list-li">'+
						'	<div class="text-title text-ellipsis">'+data.context.articleTitle+'</div>'+
						'	<div class="article-info"><span>'+data.context.articleAuthor+'</span><span>'+data.context.alterTime+'</span></div>'+
						'	<div class="float-absolute">'+
						'		<input type="radio" class="" name="checkArticle" checked="checked" value="'+data.context.articleID+'">'+
						'	</div>'+
						'</li>';
				$("#pullrefresh .list-ul").html(html);
				$("#pullrefresh .list-ul").css("transform","translate3d(0px, 0px, 0px) translateZ(0px)");
				mui('#pullrefresh').pullRefresh().disablePullupToRefresh();
				//红包规则
				$("#moneyType").find(".btn").removeClass("active");
				$("#moneyType").find(".btn").each(function(){
					if ($(this).attr("data-param") == data.context.type) {
						$(this).addClass("active");
					}
				});
				if (data.context.type == 2) {//随机金额
					$("#moneyLabel").html("红包总额：");
					$("#totalMoney").val(data.context.redPackSum).attr("placeholder", "元");
					var html = '<input type="number" id="minMoney" class="form-control array-input" value="'+data.context.minAmount+'" placeholder="元">'+
						       '<span class="short-line"></span>'+
						       '<input type="number" id="maxMoney" class="form-control array-input" value="'+data.context.maxAmount+'" placeholder="元">';
					$("#moneyInput").html(html);
				}else if (data.context.type == 1) {//固定金额
					$("#moneyLabel").html("红包个数：");
					$("#totalMoney").val(data.context.redPackNum).attr("placeholder", "个");
					var html = '<input type="number" id="singleMoney" class="form-control" value="'+data.context.singleAmount+'" placeholder="元">';
					$("#moneyInput").html(html);
				}
				
				$(".bloack-tab").find(".btn").removeClass("active");
				$(".bloack-tab").find(".btn").each(function(){
					if ($(this).attr("data-param") == data.context.areaType) {
						$(this).addClass("active");
					}
				});
				if (data.context.areaType == 0) {//不限区域
					$("#selectRegion").hide();
					$("#selectCoordinate").hide();
				}else if (data.context.areaType == 1) {//选择区域
					$("#selectRegion").show();
					$("#selectCoordinate").hide();
					$("#province").val(data.context.province);
					$("#city").val(data.context.city);
					$("#district").val(data.context.district);
				}else if (data.context.areaType == 2) {//选择坐标
					$("#selectRegion").hide();
					$("#selectCoordinate").show();
					$("#coordinateValue").val(data.context.lon+","+data.context.lat);
					$("#isShowBaiduMap").hide();
				}
				$("input[name='shareChannel']").removeAttr("checked"); 
				var shareChannel = data.context.shareChannel.split(",");
				for (var i=0; i<shareChannel.length; i++) {
					$("input[name='shareChannel']").each(function(){
						if ($(this).val() == shareChannel[i]) {
							$(this).prop("checked", true);
						}
					});
				}
				$("input[name='rewardLevel']").removeAttr("checked");
				$("input[name='rewardLevel']").each(function(){
					if ($(this).val() == data.context.rewardLevel) {
						$(this).prop("checked", true);
					}
				});
				$("#repeatGrant").val(data.context.repeatGrant);
				if (data.context.brushLimit != 0) {
					$("#brushLimit").val(data.context.brushLimit);
				}
				$("#activityStartTime").val(data.context.startTime);
				$("#activityEndTime").val(data.context.endTime);
				$("#shareArticleNum").val(data.context.shareArticleNum);
				$("#redPackDescribe").val(data.context.redPackDescribe);
				//红包封面
				$("#activityName").val(data.context.activityName);
				$("#merchantsName").val(data.context.merchantName);
				$("#sentiment").val(data.context.wish);
				$(".activityName").text(data.context.activityName);
				$(".merchantsName").text(data.context.merchantName);
				$(".sentiment").text(data.context.wish);
				
				$('.modal-dialog .modal-body').find("input").attr("disabled","disabled");
				$('.modal-dialog .modal-body').find("select").attr("disabled","disabled");
				$('.modal-dialog .modal-body').find("button").attr("disabled","disabled");
				$(".modal-dialog .modal-footer").find(".save-drafts").hide();
				$("#saveRedPacket").hide();
				$('#redPacketModal1').modal('show');
			}else{
				toastr.warning(data.msg);
			}
		}
		$(".row-list").on("click", ".red-packet-status", function(){
			var status = $(this).attr("data-param");
			var redPackID = $(this).closest(".thumbnail").find("input[name='redPackID']").val();
			base.postData(base.url.editorRedPackStatus, {redPackID:redPackID,roleType:roleType,status:status}, callbackEditorRedPackStatus);
		});
		function callbackEditorRedPackStatus(data){
			if (data.success) {
				toastr.success("设置成功");
				redPackTitle="";
				pageNum = 1;
				initRedPacketList();
			}else{
				toastr.warning(data.msg);
			}
		}
		$("#rechargeMoney").click(function(){
			if (roleType == 1) {
				window.open('https://pay.weixin.qq.com/index.php/core/home/login?return_url=%2F');	
			}else{
				$('#rechargeModel').modal('show');
			}		
		});
		//选择充值金额
		$(".recharge-money-btn").on("click", "button", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}
			$(".recharge-money-btn button").removeClass("active");
			$(this).addClass("active");
		});
		$("#createQRcode").click(function(){
			var fillMoney = $("#fillMoney").val();
			var rechargeValue = 0;
			if (fillMoney == null || fillMoney == "") {
				var selectedBtn = $(".recharge-money-btn").find(".active");
				if (selectedBtn.length == 0) {
					toastr.warning("请选择充值金额");
					return;
				}
				rechargeValue = selectedBtn.text();
			}else{
				if (parseFloat(fillMoney) < 1000) {
					toastr.warning("手填金额不能小于1000");
					return;
				}
				if (!checkIntNum(parseFloat(fillMoney) / 100)) {
					toastr.warning("手填金额要为100倍数");
					return;
				}
				rechargeValue = selectedBtn.text();
			}
			base.postData(base.url.addRechargeOrder, {userID:userID,companyID:companyID,price:rechargeValue}, callbackAddRechargeOrder);
		});
		function callbackAddRechargeOrder(data){
			if (data.success) {
				$('.recharge-qrcode').html("");
				$('.recharge-qrcode').qrcode(data.context.codeUrl);
			}else{
				toastr.warning(data.msg);
			}
		}
		
		$("#rechargeMoneyRecord").click(function(){
			initRechargeRecord(rechargePageNo);
		});
		function initRechargeRecord(){
			var data = {
				userID:userID,
				companyID:companyID,
				pageNo:rechargePageNo
			}
			base.postData(base.url.getMerchantRecord, data, callbackGetMerchantRecord);
		}
		function callbackGetMerchantRecord(data){
			if (data.success) {
				$("#rechargeModal").modal('show');
				var html = "";
				for (var i=0; i<data.context.merchantRecordList.length; i++) {
					html += '<tr>'+
							'	<td>'+data.context.merchantRecordList[i].price+'</td>'+
							'	<td>'+data.context.merchantRecordList[i].createTime+'</td>'+
							'</tr>';
				}
				$("#rechargeModal table tbody").html(html);
				if (rechargePageNo == 1){
					//初始化分页
					var totalPage = Math.ceil(data.context.totalPage/8);
					var page = {
						pageIndex:1,//初始页数
						currentPage:1,//当前页
						showPage:5,//显示页数
						totalPage:totalPage,//总页数
						onPageClick: function(page) {
							$("#rechargeModalPage").initPage(page);
							rechargePageNo = page.currentPage;
							initRechargeRecord();
			    			return false;  //默认的翻页事件
					    }
					};
					$("#rechargeModalPage").initPage(page);
				}
			}else{
				toastr.warning(data.msg);
			}
		}
		
		//显示预览model
		$(".row-list").on("click", ".preview-model", function(){
			var articleID = $(this).closest(".thumbnail").find("input[name='articleID']").val();
			base.postData(base.url.getArticleInfo, {userID:userID,companyID:companyID,articleID:articleID}, callbackShowPreviewModel);
		});
		function callbackShowPreviewModel(data){
			if (data.success) {
				var preview = '<p class="phone-title">'+data.context.articleTitle+'</p>'+
			    			  '<h6>'+base.getNowFormatToday()+'&nbsp;<a>'+$.cookie("userName")+'</a></h6>'+
			    			  '<div class="phone-body">'+data.context.articleContent+'</div>';
				$("#previewArticle").html(preview);
				$('.preview-qrcode .qrcode').html("");
				$('.preview-qrcode .qrcode').qrcode(data.context.QRCodeUrl);
				var wechat = '<div class="wechat-title text-ellipsis">'+data.context.articleTitle+'</div>'+
		    				'<div class="wechat-content">'+
			    			'	<div class="wechat-describe">'+data.context.articleAbstracts+'</div>'+
			    			'	<div class="wechat-icon">'+
			    			'		<img src="'+data.context.articleImage+'"/>'+
			    			'	</div>'+
			    			'</div>';
				$(".wechat-share").html(wechat);
				//插件管理
				var plugLength = data.context.pluginList.length;
				if (plugLength == 0) {//没有插件
					$("#previewArticle").css("padding-bottom","0");
				}else if (plugLength == 1) {//一种插件
					$("#previewArticle").css("padding-bottom","50px");
					//判断那种插件
					if (data.context.pluginList[0].pluginType == 0){//名片
						var card = data.context.pluginList[0].card;
						var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
									'	<img src="'+card.cardHeadImgUrl+'" />'+	
									'</a>'+
									'<div class="user-info-bar">'+
									'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
									'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
									'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
									'</div>';
						$(".card-tab .user-item").html(html);
						$(".card-tab .phone-item").attr("href","tel:"+card.cardUserPhone);
						$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
						$(".card-tab").css("display","table");
					} else if (data.context.pluginList[0].pluginType == 1) {//报名
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".enroll-tab .title-item").text(data.context.pluginList[0].enroll.activityTitle);
						$(".enroll-tab .btn-item button").text(data.context.pluginList[0].enroll.enrollButton);
						$(".enroll-tab").css("display","table");
					} else if (data.context.pluginList[0].pluginType == 4) {//领票
						$(".content").css("margin-bottom","50px");
						pluginID = data.context.pluginList[0].pluginID;
						$(".tickets-tab .title-item").text(data.context.pluginList[0].enroll.activityTitle);
						$(".tickets-tab").css("display","table");
					}
				}else if (plugLength > 1) {//两种插件
					for (var i=0; i<data.context.pluginList.length; i++) {
						if (data.context.pluginList[i].pluginType==0) {
							$(".merge-tab .merge-user-item").css("display", "table-cell");
							$(".merge-tab .merge-qrcode-item").css("display", "table-cell");
							var card = data.context.pluginList[i].card;
							if (card != "null" && card != null) {
								var html = '<a class="head-img customer-phone-click" href="tel:'+card.cardUserPhone+'">'+
											'	<img src="'+card.cardHeadImgUrl+'" />'+	
											'</a>'+
											'<div class="user-info-bar">'+
											'	<input type="hidden" name="cardID" value="'+card.id+'" />'+
											'	<span class="name">'+card.cardUserName+'</span><span class="position">'+card.post+'</span><br />'+
											'	<a class="phone customer-phone-click" href="tel:'+card.cardUserPhone+'">'+card.cardUserPhone+'</a>'+
											'</div>';
								$(".merge-tab .merge-user-item").html(html);
								$(".user-qrcode-img").html('<img src="'+card.wxQcImgUrl+'" />');
							}
						} else if (data.context.pluginList[i].pluginType==1) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-enroll-item").css("display", "table-cell");
							$(".merge-tab .merge-enroll-item").html('<span class="font-theme">报名</span>');
						} else if (data.context.pluginList[i].pluginType==4) {
							pluginID = data.context.pluginList[i].pluginID;
							$(".merge-tab .merge-ticket-item").css("display", "table-cell");
							$(".merge-tab .merge-ticket-item").html('<span class="font-theme">领票</span>');
						}
					}
					$(".merge-tab").css("display","table");
				}
				$("#previewModel").modal('show');
			}else{
				toastr.warning(data.msg);
			}
		}
		function initDateTime(){
			$('.form_datetime').datetimepicker({
		        //language:  'fr',
		        format:'yyyy-mm-dd hh:ii:ss',
		        language:'zh-CN',
		        startDate: getNowFormatDate(),
		        weekStart: 1,
		        todayBtn:  true,
				autoclose: true,
				todayHighlight: 1,
				startView: 2,
				minView: 0,
				forceParse: 0,
		        showMeridian: true
		    });
		}
		function initBaiduMap(){
			var map = new BMap.Map("baiduMap");          // 创建地图实例  
			var point = new BMap.Point(116.404, 39.915);  // 创建点坐标  
			map.centerAndZoom(point, 13);                 // 初始化地图，设置中心点坐标和地图级别  
			map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
			//定位
			var geolocation = new BMap.Geolocation();
			geolocation.getCurrentPosition(function(r){
				if(this.getStatus() == BMAP_STATUS_SUCCESS){
					var mk = new BMap.Marker(r.point);
					map.addOverlay(mk);
					map.panTo(r.point);
	//				alert('您的位置：'+r.point.lng+','+r.point.lat);
				}else {
					alert('failed'+this.getStatus());
				}        
			},{enableHighAccuracy: true});
			//控件
			var size = new BMap.Size(10, 20);
			map.addControl(new BMap.CityListControl({
			    anchor: BMAP_ANCHOR_TOP_LEFT,
			    offset: size,
			}));
			var top_left_control = new BMap.ScaleControl({anchor: BMAP_ANCHOR_TOP_LEFT});// 左上角，添加比例尺
			var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
			var top_right_navigation = new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}); //右上角，仅包含平移和缩放按钮
//			map.addControl(top_left_control);        
			map.addControl(top_left_navigation);     
			map.addControl(top_right_navigation); 
			//单击获取点击的经纬度
			map.addEventListener("click",function(e){
				$("#coordinateValue").val(e.point.lng + "," + e.point.lat);
			});
//			resultLocal = new BMap.LocalSearch(map, {
//				renderOptions: {map: map, panel: "r-result"}
//			});
			resultLocal = new BMap.LocalSearch(map, {
				renderOptions:{map: map}
			});
		}
		$("#moneyType").on("click", "button", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}
			$(this).closest(".btn-group-justified").find(".btn").removeClass("active");
			$(this).addClass("active");
			if ($(this).attr("data-param") == 2) {//随机金额
				$("#moneyLabel").html("红包总额：");
				$("#totalMoney").val("").attr("placeholder", "元");
				var html = '<input type="number" id="minMoney" class="form-control array-input" placeholder="元">'+
					       '<span class="short-line"></span>'+
					       '<input type="number" id="maxMoney" class="form-control array-input" placeholder="元">';
				$("#moneyInput").html(html);
			}else if ($(this).attr("data-param") == 1) {//固定金额
				$("#moneyLabel").html("红包个数：");
				$("#totalMoney").val("").attr("placeholder", "个");
				var html = '<input type="number" id="singleMoney" class="form-control" placeholder="元">';
				$("#moneyInput").html(html);
			}
		});
		//地址选择
		$(".bloack-tab").on("click", "button", function(){
			if ($(this).attr("class").indexOf("active") != -1) {
				return;
			}
			$(this).closest(".bloack-tab").find(".btn").removeClass("active");
			$(this).addClass("active");
			if ($(this).attr("data-param") == 0) {
				$("#selectRegion").hide();
				$("#selectCoordinate").hide();
			}else if ($(this).attr("data-param") == 1) {
				$("#selectRegion").show();
				$("#selectCoordinate").hide();
			}else if ($(this).attr("data-param") == 2) {
				$("#selectRegion").hide();
				$("#selectCoordinate").show();
				$("#isShowBaiduMap").show();
			}
		});
		//确认坐标
		$("#confirmAddress").click(function(){
			if ($("#coordinateValue").val() == "") {
				toastr.warning("请选择坐标");
				return;
			}
			$("#searchAddress").hide();
			$("#baiduMap").hide();
		});
		//重新选择
		$("#restAddress").click(function(){
			$("#coordinateValue").val("");
			$("#baiduMap").show();
			$("#searchAddress").val("").show();
		});
		//地图搜索
		$("#searchAddress").on("keyup",function() {
			resultLocal.search($(this).val());
		});
		$("#showBrushPopover").on("mouseover mouseout", function(event){
			if(event.type == "mouseover"){
				//鼠标悬浮
				$("#brushPopover").show();
			}else if(event.type == "mouseout"){
				//鼠标离开
				$("#brushPopover").hide();
			}
		});
		//文字限制
		$(".input-words").on("keyup", function() {
			$(this).closest(".words-limit").find(".number-words span").text($(this).val().length);
			$("."+$(this).attr("open-data")).text($(this).val());
		});
		
	</script>
</body>
</html>
